package bg.tu.varna.pms.client.listener;

import bg.tu.varna.pms.model.ChatMessage;
import bg.tu.varna.pms.model.ChatRoom;
import bg.tu.varna.pms.model.FileMessage;
import bg.tu.varna.pms.model.communication.SyncMessage.OperationType;

/**
 * The listener interface for receiving messaging events.
 * The class that is interested in processing a messaging
 * event implements this interface, and the object created
 * with that class is registered with a component using the
 * component's <code>addMessagingListener<code> method. When
 * the messaging event occurs, that object's appropriate
 * method is invoked.
 *
 * @see MessagingEvent
 */
public interface MessagingListener {

	/**
	 * Chat rooms modification.
	 *
	 * @param chatRooms the chat rooms
	 */
	void chatRoomsModification(ChatRoom[] chatRooms);

	/**
	 * Chat room modification.
	 *
	 * @param chatRoom the chat room
	 * @param type the type
	 */
	void chatRoomModification(ChatRoom chatRoom, OperationType type);

	/**
	 * Message received.
	 *
	 * @param chatRoom the chat room
	 * @param message the message
	 */
	void messageReceived(ChatRoom chatRoom, ChatMessage message);

	/**
	 * Message send.
	 *
	 * @param chatRoom the chat room
	 * @param message the message
	 */
	void messageSend(ChatRoom chatRoom, ChatMessage message);

	/**
	 * Message delivered.
	 *
	 * @param chatRoom the chat room
	 * @param message the message
	 */
	void messageDelivered(ChatRoom chatRoom, ChatMessage message);

	/**
	 * File received.
	 *
	 * @param chatRoom the chat room
	 * @param file the file
	 */
	void fileReceived(ChatRoom chatRoom, FileMessage file);

	/**
	 * File send.
	 *
	 * @param chatRoom the chat room
	 * @param file the file
	 */
	void fileSend(ChatRoom chatRoom, FileMessage file);

	/**
	 * File delivered.
	 *
	 * @param chatRoom the chat room
	 * @param file the file
	 */
	void fileDelivered(ChatRoom chatRoom, FileMessage file);

	/**
	 * File progress.
	 *
	 * @param chatRoom the chat room
	 * @param file the file
	 * @param progress the progress
	 */
	void fileProgress(ChatRoom chatRoom, FileMessage file, int progress);

}
